<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"			
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

	<!-- 
		Explain:
		
		* Static navigation
		* Dynamic navigation
		* Advanced navigation rules could be added to the faces_config.xml.
		** Reason: Separate business and presentation (e.g. business outcome "success" to view "welcome")!
		
	 -->
	 

	<h:body> 
	
		<h:messages />
	
		<h:form>
		
			<h:panelGrid columns="2">
			
				<h:outputLabel value="Username" for="user" />
				<h:inputText id="user" label="Username" value="#{user.name}" />
				
				<h:outputLabel value="Password" for="pass" />
				<h:inputSecret id="pass" label="Password" value="#{user.pass}" />
				
				<h:panelGroup />
				<h:commandButton value="Login" action="welcome" /> 
				<!-- Define the outcome directly. If no mapping is defined, the outcome is transfered automatically to a view id -->

				<h:panelGroup />
				<h:commandButton value="Login (dyn)" action="#{user.login}" /> 
				<!-- Define the outcome directly. If no mapping is defined, the outcome is transfered automatically to a view id -->

			</h:panelGrid>
		
		</h:form>
	
	</h:body>

</html>